<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>支付回调</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- <link rel="stylesheet" type="text/css" media="screen" href="main.css" /> -->
  <!-- <script src="main.js"></script> -->
  <style>
    .paystatus_box{
      background: #ffffff;
    }
    .paystatus-box{
      width: 500px;
      margin: 30px auto 20px;
      padding: 85px 40px 0;
      background: #ffffff;
      text-align: center;
      overflow: hidden;
      min-height: 440px;
    }
    .paystatus-box .text{
        font-size: 14px;
        padding: 17px 0 25px;
        line-height: 20px;
        color: #777;

      }
  </style>
</head>
<body>
  <div class="knife_container paystatus_box">
    <div class="paystatus-box" id="showText">
      <template v-if="parseInt(query.payStatus) === 1">
        <img src="./img/success.png" width="60"/>
        <div class="text">您的订单已成功支付,工作人员立马处理,请关注订单信息或咨询400-992-0808.</div>
      </template>
      <template v-else>
          <img src="./img/error.png" width="60"/>
        <div class="text">支付失败，可能银行订单支付状态更新有延迟
          请您稍后查看订单中心或咨询 400-992-0808!</div>
      </template>
    </div>
  </div>
  <script>
    function getUrlQuery () {
      const querylist = getQueryArgs()
      const box = document.getElementById('showText')
      let str = ''
      const status = querylist.payStatus
      if (status === '1') {
        str= '<img src="./img/success.png" width="60"/>' +
        '<div class="text">您的订单已成功支付,工作人员立马处理,请关注订单信息或咨询400-992-0808.</div>'
      } else {
        str = '<img src="./img/error.png" width="60"/>' +
        '<div class="text">支付失败，可能银行订单支付状态更新有延迟' +
        '请您稍后查看订单中心或咨询 400-992-0808!</div>'
      }
      box.innerHTML = str
    }

    function getQueryArgs(){
      var qs =( location.search.length> 0 ? location.search.substring(1):" "),
      args ={},
      items =qs.length>0 ?qs.split('&') :[],
      item=null,
      name=null,
      value=null;
      for(var i=0;i<items.length;i++){
        item =items[i].split('=');
        name = decodeURIComponent(item[0]);
        value = decodeURIComponent(item[1]);
        if(name.length){
          args[name] =value;
        }
      }
       return args;
      }
    window.onload = function () {
      getUrlQuery()
    }
  </script>
</body>
</html>